<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<title>问题池列表(管理员端)</title>

<%@include file="/WEB-INF/views/commons/common.jsp" %>

<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/jquery-easyui/1.4.3/themes/metro/easyui.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/bootstrap-dialog3/css/bootstrap-dialog.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/validation-engine/validationEngine.jquery.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/css/search-theme.css">

</head>
<body  data-grid="easyui">
	<div class="path"><span class="right-index">&gt;</span>  现在的位置：问题池列表(管理员端)</div>
<div class="tab-content">
	<div class="fold_ex">
		<h2 class="title-h2">
			<span style="width:100%;">
			</span>
			<a href="javascript:void(0);" class="hide-next-btn">收起</a>
		</h2>
		
		<div>
		<form action="#">
			<table class="search-table container">
				<tr>
					<td class="text-right col-xs-2">问题详情</td>
					<td class="col-xs-4">
						<input type="text" class="form-control" name="question" value="" placeholder="请输入关键字"/>
					</td>
					<td class="text-right col-xs-2">问题来源</td>
					<td class="col-xs-4">
						<select name="questionSource" class="form-control">
							<option value="" selected="selected">请选择</option>
							 <c:forEach items="${questionSources}" var="state">
								<option value="${state.code}">${state.value}</option>
							</c:forEach> 
						</select>
					</td>
				</tr>
				<tr>
					<td class="text-right col-xs-2">提问时间起</td>
					<td class="col-xs-4"><input type="text" class="form-control"
						id="askStartTime" name="askStartTime" value=""
						onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'askEndTime\')}'});"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
					</td>
					<td class="text-right col-xs-2">提问时间止</td>
					<td class="col-xs-4"><input type="text" class="form-control"
						id="askEndTime" name="askEndTime" value=""
						onFocus="WdatePicker({minDate: '#F{$dp.$D(\'askStartTime\')}'});"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
					</td>
				</tr>
				
				<tr>
					<td class="text-right col-xs-2">答疑结束时间起</td>
					<td class="col-xs-4"><input type="text" class="form-control"
						id="answerStartTime" name="answerStartTime" value=""
						onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'answerEndTime\')}'});"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
					</td>
					<td class="text-right col-xs-2">答疑结束时间止</td>
					<td class="col-xs-4"><input type="text" class="form-control"
						id="answerEndTime" name="answerEndTime" value=""
						onFocus="WdatePicker({minDate: '#F{$dp.$D(\'answerStartTime\')}'});"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
					</td>
				</tr>
				
				<tr>
					<td class="text-right col-xs-2"></td>
					<td class="text-right">
						<button type="button" class="btn search-btn" data-method="search"><i class="fa fa-search"></i>&nbsp;查询&nbsp;</button>
						<button type="button" class="btn search-btn" data-method="clear"><i class="fa fa-trash"></i>&nbsp;清空&nbsp;</button>
					</td>
				</tr>
			</table>
		</form>
		</div>

		<hr class="search-line"/>
		<table class="easyui-datagrid" >
			<thead>
				<tr>
					<th data-options="field:'id',checkbox:true">选择</th>
					<th data-options="field:'questionSource',width:50,align:'center'">问题来源</th>
					<th data-options="field:'questionDescribe',width:200,align:'center'">问题详情</th>
					<th data-options="field:'quesTime',width:50,align:'center'">提问时间</th>
					<th data-options="field:'quesDiffLevel',width:30,align:'center'">难度</th>
				</tr>
			</thead>
		</table>
	</div>
</div>

<script type="text/javascript" src="${base_href}/static/ui-frame/jquery/1.11.3/jquery.js"></script>


<script type="text/javascript" src="${base_href}/static/ui-frame/iframe-auto-height/jquery.autoheight.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap/3.3.5/js/bootstrap.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap-dialog3/js/bootstrap-dialog.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/jquery-easyui/1.4.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/jquery-easyui/1.4.3/easyui.util.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/webuploader/jquery-form.js"></script>

<script type="text/javascript" src="${base_href}/static/ui-frame/requirejs/2.2.0/require.js"></script>

<script type="text/javascript">
requirejs.config({
	baseUrl: '<c:url value="/static/"/>',
	paths: {
		Grid: 'component/grid/js/ms-grid',
	},
	config: {
		'Grid': { contextPath: '<c:url value="/"/>' },
	}
});


require(['Grid'], function(Grid) {
	
	Grid.columns({
		questionDescribe: {
			formatter: function(value, row, index) {
				var v = value == null ? "" : $('<div/>').text(value).html();
				return "<a href='javaScript:void(0);' onclick=\"grid.questionDescribe(event, " + index + ")\" class='grid-button' plain='true' title='"+ v +"'><div>" +  v + "</div></a>";
			},
			event: function(event, index) {
				var row = this.grid.datagrid('getRows')[index];
				var param = {quesId: row.id};
				
				var url = basePath + "/teacherController/openReadPage.html?" + $.param(param);
				var left=Math.round((window.screen.width)/2);  
				var screenLocation = "width=960px,height=960,left="+left+",right=0,menubar=yes,resizable=yes,scrollbars =yes";
				this.windowOpen(url, "详细信息",screenLocation); //打开题目只读页面
				event.stopPropagation();
			}
		},
		quesDiffLevel:{
			formatter: function(value, row, index) {
				var vv ;
				if(value == 1){
					vv = "简单";
				}else if(value == 2){
					vv = "一般";
				}else if(value == 3){
					vv = "困难";
				}
				return "<span>" + vv + "</span>"
			}
		}
		,
		questionSource:{
			formatter: function(value, row, index) {
				var vv ;
				if(value == 1){
					vv = "QQ群";
				}else if(value == 2){
					vv = "微信小程序";
				}else if(value == 3){
					vv = "银成邮件";
				}else if(value == 4){
					vv = "图书纠错";
				}else if(value == 5){
					vv = "其它";
				}
				return "<span>" + vv + "</span>"
			}
		}
	});
	
	$(function() {
		window.grid = Grid.events();
	})
}) 
</script>


</body>
</html>
